import { Actions, ActTypes } from "./action";

export interface DataState {
  headerTitle: string;
}

export interface UIState {}

export type State = DataState & UIState;

const initialState: State = {
  headerTitle: "头条搜索"
};

export const reducer = (
  state: State = { ...initialState },
  action: Actions
): State => {
  switch (action.type) {
    case ActTypes.Destroy: {
      return { ...initialState };
    }
    default:
      return state;
  }
};
